class User:
    count = 0  # 类属性
    #
    # #带参构造会覆盖空参构造
    # def __init__(self, name, age, sex):
    #     self.__name = name #下划线修饰的私有属性
    #     self.age = age
    #     self.sex = sex
    #
    #后写的会覆盖先写的
    def __init__(self, name=None, age=None, sex=None,email=None):
        self.__name = name #下划线修饰的私有属性
        self.age = age
        self.sex = sex
        self.email = email

    # def __del__(self):
    #     print("对象被销毁")

    #公共方法访问私有属性
    def setName(self, name):
        self.__name = name

    def getName(self):
        return self.__name

    def show(self):
        print("show-----------")
        self.myprint()

    @classmethod
    def show2(cls):
        print("classmethod-----------")

    @staticmethod
    def show3(str1,str2):
        print(f"staticmethod-----{str1}----{str2}--")

    def myprint(self):
        print("myprint-----------")

class Parent:
    __name = "parent"
    def __show1(self):
        print(f"parent show-------{self.name}----")

class Child(Parent):
    sub_name = "child"
    def show1(self):
        print(f"child show-------{self.sub_name}----")

class Son(Parent):
    sub_name = "son"
    def show1(self):
        print(f"son show-------{self.sub_name}----")